home *** CD-ROM | disk | FTP | other *** search
- /*
- * $VER: SaveBufferAs_TIFF.ifx
- * Modified by dhomas trenn (01 Mar 1999)
- * -> Modified to support TIFF images
- * -> CHANGES extension to 'New Extension' (rather than appending it)
- *
- * Copyright © 1992-1996 Nova Design, Inc.
- * Written by Thomas Krehbiel
- *
- * Save main buffer as TIFF.
- *
- * Inputs:
- * Word(Arg(1),1) = Frame number (1 - N)
- * Word(Arg(1),2) = Main filename ("-" if not specified)
- * Word(Arg(1),3) = Swap filename ("-" if not specified)
- * Word(Arg(1),4) = Sequence number (?)
- * Word(Arg(1),5) = Total number of frames (N)
- *
- */
-
- options results
-
- framenum = Word(Arg(1),1)
- mainname = Word(Arg(1),2)
- swapname = Word(Arg(1),3)
- seq = Word(Arg(1),4)
- framemax = Word(Arg(1),5)
-
- base = 'Autofx_SaveBufferAsTIFF_'
-
- path = getclip(base'Path'seq)
- ext = getclip(base'Ext'seq)
- lzw = getclip(base'LZW'seq)
-
- /* gracefully exit if no buffer */
- GetMain
- if rc ~= 0 then exit 0
-
- i = pos('*', ext)
- if i > 0 then ext = left(ext,i-1) || right('00000'||framenum,5) || substr(ext,i+1)
-
- i = lastpos('.', mainname)
- if i > 0 then mainname = left(mainname, i-1)
-
- outfile = mainname||ext
- if path ~= "" then do
- i = lastpos('/',mainname)
- if i = 0 then i = lastpos(':',mainname)
- if i = 0 then
- file = mainname
- else
- file = substr(mainname,i+1)
-
- if right(path,1) ~= ':' then path = path||'/'
- outfile = path||file||ext
- end
-
- if lzw = "1" then
- lzw = "LZW"
- else
- lzw = "NoCompress"
-
-
- SaveBufferAs TIFF '"'outfile'"' lzw
- exit rc
-